package com.kaola.service.impl;

import java.util.List;

import com.kaola.dao.CategoryDAO;
import com.kaola.pojo.Category;
import com.kaola.service.CategoryService;

public class CategoryServiceImpl implements CategoryService {

	private CategoryDAO categoryDAO;
	
	public CategoryDAO getCategoryDAO() {
		return categoryDAO;
	}

	public void setCategoryDAO(CategoryDAO categoryDAO) {
		this.categoryDAO = categoryDAO;
	}

	public void add(Category category) {
		categoryDAO.add(category);
	}

	public List<Category> listForLevel1() {
		return categoryDAO.listForLevel1();
	}

	public List<Category> listForLevel2(Category cLevel1) {
		return categoryDAO.listForLevel2(cLevel1);
	}

	public List<Category> listForLevel3(Category cLevel2) {
		return categoryDAO.listForLevel3(cLevel2);
	}

	public List<Category> listAllLevel2() {
		return categoryDAO.listAllLevel2();
	}

	public List<Category> listAllLevel3() {
		return categoryDAO.listAllLevel3();
	}
	
	public List<Category> listAll() {
		return categoryDAO.listAll();
	}
	
	public void delete(int id) {
		categoryDAO.delete(id);
	}
}
